#!/bin/bash
rm -rf dist
rm -rf view
rm -rf app/asset/asset.go
cd ./views
npm run build
cd -
echo "开始打包前端到golang"
go-bindata -o=app/asset/asset.go -pkg=asset view/...
echo "开始打包 golang。。。"
CGO_ENABLED=0 gox -osarch="linux/amd64" -ldflags "-s -w " -gcflags -m -output dist/xpms
echo "打包结束 golang。。。"
upx -f -9 dist/xpms
docker build -t registry.cn-shenzhen.aliyuncs.com/yfsz-test/xpms:$1.release .
docker push registry.cn-shenzhen.aliyuncs.com/yfsz-test/xpms:$1.release